### 练习 3：编写石头剪刀布小游戏
# 1. 计算机随机出拳 random.choice(["shitou", "jiandao", "bu"])
# 2. 玩家自己决定如何出拳  input("shitou/jiandao/bu: ")
import random
all_choices = ["shitou", "jiandao", "bu"]
win_list = [  # 玩家获胜的情况
    ["shitou", "jiandao"], ["jiandao", "bu"], ["bu", "shitou"]
]
computer = random.choice(all_choices)  # 随机出拳
print("computer:", computer)
player = input("shitou/jiandao/bu: ")
if computer == player:
    print("平局")
elif [player, computer] in win_list:
    print("player win~")
else:
    print("computer win~")

# if player == "shitou":
#     if computer == "shitou":
#         print("平局")
#     elif computer == "jiandao":
#         print("player win~")
#     else:  # computer: bu
#         print("computer win~")
# elif player == "jiandao":
#     if computer == "shitou":
#         print("computer win~")
#     elif computer == "jiandao":
#         print("平局")
#     else:  # computer: bu
#         print("player win~")
# else:  # player: bu
#     if computer == "shitou":
#         print("player win~")
#     elif computer == "jiandao":
#         print("computer win~")
#     else:  # computer: bu
#         print("平局")
